const { defineConfig } = require('@vue/cli-service');
const path = require('path');
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')

module.exports = defineConfig({
  transpileDependencies: true,
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ],
    resolve: {
      alias: {
        'api': path.resolve(__dirname, './src/api'),
        'view': path.resolve(__dirname, './src/views'),
        'lay': path.resolve(__dirname, './src/layout'),
        'util': path.resolve(__dirname, './src/utils'),
        'router': path.resolve(__dirname, './src/router'),
        'store': path.resolve(__dirname, './src/store'),
        'com': path.resolve(__dirname, './src/components'),
      }
    }
  }
})